Item={}
function Item:new(id,name)
    local o={}
 setmetatable(o, Item)
    o.__index = Item
    o.id = id
    o.name = name
 return o
end

ItemTable={}
temp={"a","b","c","d"}
for k,v in pairs(temp) do
 local item=Item:new(k,v)
    ItemTable[k]=item
end

for i,v in pairs(ItemTable)do
 print(v.id,v.name)
end